<a name=top></a>

<?php require_once '../yubiphpbase/appinclude.php';

$page = $_SERVER['PHP_SELF'];
$loggedIn = false;
$cookieExists = false;

if (($usrid = getUsrIdFromSession()) > 0) {
	$loggedIn = $cookieExists = true;
	$_SESSION['usrid'] = $usrid;
	//echo 'usrid:'.$usrid.' loggedIn:'.$loggedIn.' cookieExists:'.$cookieExists;
} else if (($usrid = getUsrIdFromCookie()) > 0) {
	$cookieExists = true;
//	echo 'Usrid:'.$usrid.' loggedIn:'.$loggedIn.' cookieExists:'.$cookieExists;
}


if ($devMode) {
	writeLog('cookieExists:'.$cookieExists);
}

?>

<!-- logo + top level nav + login -->	
<div id="navbar_container">
	<div id="logonav">
		<div id="logo"><?php $home = strikeLine();?></div>
       	
<div id="tlnav">
<h1>
<?php
if (!$home){	
	echo '<a href='.$appssl.'>Home</a><img src="images/seperator.gif">';
}
?>
<a href="http://forum.yubico.com">Forum</a><img src="images/seperator.gif">
<a href=http://code.google.com/p/yms/>The Project</a><img src="images/seperator.gif">
</h1>
</div>

</div>
    
<div class="greenbar">
         	
<?php
if ($loggedIn) { // Logged in, say hi!
	echo $_SESSION['hi'];
} else {
	echo '<center><b><font color=#FFFFFF size=+1>'.
		'Yubikey Management Service</font></b>'.
		'<a href=http://yubico.com/updates/081006/>'.
		'<font color=#FFFFFF>&nbsp;&nbsp; What is it?</font>'.
		'</a></center>';
}
?>		
		
</div><!-- end green bar -->

</div><!-- end nav bar-->

<?php
function strikeLine() {
	global $loggedIn, $page;
	$home = false;
	if (strpos($page, 'logoff.php') !== false) {
		echo LOGOLINK;
		$home = true;
	} else if (strpos($page, 'index.php') !== false) {
		echo LOGO;
		$home = true;
	} else if (strpos($page, 'forget.php') !== false ||
			   strpos($page, 'yubikey.php')!== false) {
		echo LOGOLINK;
		$home = true; // so on top right hdr, login box & talk boxes will not show
	} else {
		echo LOGOLINK;
	}
	return $home;
}
?>
